﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;

namespace Bind.View
{
    /// <summary>
    /// QureyView.xaml 的交互逻辑
    /// </summary>
    public partial class QureyView : UserControl
    {
        public QureyView()
        {
            InitializeComponent();
        }

        private void TextBox_KeyDown(object sender, KeyEventArgs e)
        {
            try
            {
                if (e.Key==Key.Enter)
                {
                    string sn = TextBoxSN.Text.Trim();
                    var list = BindView.bindDAL.GetData(sn);
                    if (list!=null)
                    {
                        DataGridQry.ItemsSource = list;
                    }
                }
            }
            catch (Exception ex)
            {
                HandyControl.Controls.Growl.Error(ex.Message);
                BaseTool.LogHelper.WriteError("错误", ex);
            }
        }
    }
}
